<link rel="stylesheet" type="text/css" href="<?php echo PUBLIC_URL ?>css/content.css"><!-- 首页内容区域大盒子-->
<link rel="stylesheet" type="text/css" href="<?php echo PUBLIC_URL ?>css/with.css">
<script src="<?php echo PUBLIC_URL ?>js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
<div class="n" style="height:35px;"></div><!--放个div，才能让龙播图在ff中动作-->
<div id="content">
    <div class="nav" style="height:60px;background:#FBFBFA;text-align:left;">
        <font style="margin-left:20px;height:60px;line-height:60px;padding-top:0px;"> 当前位置：<font style="color:green">首页 > 搜索 ></font> </font>
    </div>
<div id="content-tow"><!-- 包括左右两个盒子start-->
		<!-- 便利区左盒子 -->
    <div style="position:relative;">
        
        <div style="float:left;width:69%;position:relative;">
			<div style="position:relative; width:100%; height:58px; background:#AAc619;top:0px;">
            <input style="position:absolute;top:4px;width:85%;height:43px;left:3%; font-size:30px;" style="text" name="sea">
            <font id="searcharticle" style="position:absolute; right:10px;top:10px;font-size:30px;color:#EDEDED;cursor:pointer;" >搜&nbsp;索</font>
            </div>
            <div id="append">
             <?php
                    foreach($searchArr['searchList'] as $val){

             ?>
                     <div id="<?php echo $val['articleID']; ?>" name="append" style="cursor:pointer;position:relative;top:20px;text-align:left;border-bottom:1px solid #B4B4B4;padding:20px;height:200px;line-height:20px;">
                            <h3><?php echo $val['articleTitle']; ?></h3>
                            <p style="display:block; height:100px; width:100%;overflow:hidden;text-overflow:ellipsis;color:#A9B2B4">
                            <?php echo $val['articleContent']; ?>
                            </p>
                            <font color="#AAC619" size="2"><?php echo $val['articleDate']; ?></font>
                     </div>
            <?php } ?>
            </div>
            <!--分页 -->
            <div id="page" style="width:100%;margin-top:30px;height:60px;padding-top:25px;">
                <?php echo $searchArr['page']; ?>
            </div>
             <!--分页 -->
		</div>
        
                <!--测边栏(1)start -->
                <?php  include_once(VIEWS_URL.'welcome/aside_one.php');  ?>
                       <div style="width:100%;float:right;margin-top:1300px;">
                            <img width="100%;" src="<?php echo PUBLIC_URL."images/ao/ad-img02.jpg"; ?>" />
                       </div>
                <!--测边栏end -->  
               
	</div>
</div>
    <!-- 包括左右两个盒子end-->
</div>
<!-- 首页内容区域大盒子-->
<script>
    $('font[name=ajaxpage]').live('click', function(){
        var ppage = $(this).attr('id');
        
        $.ajax({
            url:'<?php echo DOCUMENT."welcome/ajaxsearchpage"; ?>',
            data:'ppage='+ppage,
            type:'get',
            success:function(data){
                if(data['status'] == 1){
                    var app=$('#append');
                        var page=$('#page');
                        app.empty();
                        page.empty();
                            $.each(data['searchList'], function(k, v){
                                                    var appen = $('<div id="'+v['articleID']+'"name="append" style="cursor:pointer;position:relative;top:20px;text-align:left;border-bottom:1px solid#B4B4B4;padding:20px;height:200px;line-height:20px;"><h3>'+v['articleTitle']+'</h3><p style="display:block; height:100px; width:100%;overflow:hidden;text-overflow:ellipsis;color:#A9B2B4">'+v['articleContent']+'</p><font color="#AAC619" size="2">'+v['articleDate']+'</font></div>');
                                                     var app=$('#append');
                                                     app.append(appen);
                                 
                                               });
                                            var pa = data['page'];
                                            
                                            page.append(pa);
                }
            },
            error:function(){
                alert('失败');
            },
            dataType:'json'
        });
    });
    
    $('#searcharticle').live('click', function(){
       var content = $(this).parent().find('input[name=sea]').val();
        $.ajax({
            url:'<?php echo DOCUMENT."welcome/ajaxsearchpage"; ?>',
            data:'searchID='+content,
            type:'get',
            success:function(data){
                if(data['status'] == 1){
                    if(data['searchList'] == undefined){
                        window.location.reload();
                    }
                    var app=$('#append');
                        var page=$('#page');
                        app.empty();
                        page.empty();
                            $.each(data['searchList'], function(k, v){
                                                    var appen = $('<div id="'+v['articleID']+'" name="append" style="cursor:pointer;position:relative;top:20px;text-align:left;border-bottom:1px solid#B4B4B4;padding:20px;height:200px;line-height:20px;"><h3>'+v['articleTitle']+'</h3><p style="display:block; height:100px; width:100%;overflow:hidden;text-overflow:ellipsis;color:#A9B2B4">'+v['articleContent']+'</p><font color="#AAC619" size="2">'+v['articleDate']+'</font></div>');
                                                     var app=$('#append');
                                                     app.append(appen);
                                 
                                               });
                                            var pa = data['page'];
                                            
                                            page.append(pa);
                }else{
                    window.location.reload();
                }
            },
            error:function(){
                window.location.reload();
            },
            dataType:'json'
        });
            
    })
    
    $('div[name=append]').live({
    
        click:function(){
            var articleID = $(this).attr('id');
            window.location.href="<?php echo DOCUMENT.'article/show_article_content?ID=';?>"+articleID;
        },
        
        mouseover:function(){
            $(this).css('background', '#C4D85F');
        },
        mouseout:function(){
            $(this).css('background', '#FFFFFF');
        }
    });
</script>



    